home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 5700 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.5 KB

  1. Path: mail2news.demon.co.uk!genesis.demon.co.uk
  2. From: Lawrence Kirby <fred@genesis.demon.co.uk>
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Can anyone optimize this VERY simple piece of code?
  5. Date: Tue, 20 Feb 96 18:56:25 GMT
  6. Organization: none
  7. Message-ID: <824842585snz@genesis.demon.co.uk>
  8. References: <19950700wnr@samtech.demon.co.uk> <31276E30.26C0@ix.netcom.com>
  9. Reply-To: fred@genesis.demon.co.uk
  10. X-NNTP-Posting-Host: genesis.demon.co.uk
  11. X-Newsreader: Demon Internet Simple News v1.27
  12. X-Mail2News-Path: genesis.demon.co.uk
  13.  
  14. In article <31276E30.26C0@ix.netcom.com>
  15.            hcross@ix.netcom.com "Henry Cross" writes:
  16.  
  17. >>  Personally I'd use a VERY simple language. Assembly!
  18. > This is a job for inline assembly, compiler allowing, or an assembler 
  19. >if not. 
  20. > However if you must persist in C, use pointers every place possible.
  21.  
  22. This hasn't been the case in any reasonable compiler for a number of years
  23. now.
  24.  
  25. > For example vgamem[count] could be a pointer that incremented++ vice
  26. > an index to an array. (Which is very expensive computationally.)
  27.  
  28. The strength reduction required to convert an index to a pointer is one
  29. of the simpler optimistaion that compilers perform. Code that uses indices
  30. often provides more information to the compiler for optimisation purposes so
  31. may even result in better code generated.
  32.  
  33. -- 
  34. -----------------------------------------
  35. Lawrence Kirby | fred@genesis.demon.co.uk
  36. Wilts, England | 70734.126@compuserve.com
  37. -----------------------------------------
  38.